﻿// ***************************************************************
//  Version: 0.4.0   			Date: 12/25/2007-2008
//	Auther: Deng Yangjun Email: dyj057@gmail.com  	
//  -------------------------------------------------------------
//  ORM操作接口定义
//  -------------------------------------------------------------
//  (C)2007-2008 Midapex All Rights Reserved.
// ***************************************************************
//
// ***************************************************************
using System;

namespace Midapex.SmartOrm
{
    /// <summary>
    /// Orm操作的接口
    /// </summary>
    public interface IOrm
    {
        void CreateTable<T>();
        void CreateTable(Type t);
        int Delete(Type type, Query query);
        void Delete(object parent, object child);
        bool Delete(object target);
        int Delete<T>(Query query);
        bool DeleteTable<T>();
        bool DeleteTable(Type type);
        bool IsObjectExist(object obj);
        bool IsObjectExist(Type type, object idValue);
        bool IsObjectExist<T>(object objId);
        bool IsTableExist(Type t);
        bool IsTableExist<T>();
        T Load<T>(object targetId);
        object Load(Type t, object objId);
        T[] LoadAll<T>();
        void RebuildAllTables();
        void Save(object parent, object child);
        void Save(object target);
        T[] Select<T>(Query query);
        Array Select(Type type, Query query);
        void Update(object target);
    }
}
